package panda.query.test;

import panda.metainfo.TableManager;
import panda.planner.Planner;
import panda.planner.impl.NormalUpdatePlanner;
import panda.query.tree.TableNode;
import panda.server.Panda;
import panda.transaction.Transaction;

public class SQLWriteContent {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Panda.init("F:\\Data");

		Transaction tx = new Transaction();
		long time = System.currentTimeMillis();
		for (int i = 0; i < 10000; i++)
			Panda.getPlanner().executeUpdate("INSERT INTO table1 VALUES(" 
					+ i + ", '" + i +"')", tx);
		tx.commit();
		
		System.out.println("TOTAL TIME = " + (System.currentTimeMillis() - time));
		
		System.out.println("PARSE TIME = " + Planner.parsertime);
//		System.out.println("TOKEN TIME = " + NormalUpdatePlanner.getTokenTime);
		System.out.println("READ TOKEN TIME = " + TableManager.readTableTime);
//		System.out.println("STAT TIME = " + TableNode.time);
		tx.commit();
	}

}
